package com.pro.springbootpro.event;

import org.springframework.context.ApplicationEvent;

/**
 * 自定义事件
 */
public class MyEvent extends ApplicationEvent {
    public MyEvent(Object source) {
        super(source);
    }

    /**
     * 事件处理事项
     *
     * @param msg
     */
    public void printMsg(String msg) {
        System.out.println("监听到事件发送邮件：" + MyEvent.class + "---{}" + msg);
    }

    /**
     * 事件处理事项
     *
     * @param msg
     */
    public void printMsg2(String msg) {
        System.out.println("监听到事件发送短信：" + MyEvent.class + "---{}" + msg);
    }
}